wayland: fix filechooser crash
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Wed, 23 Aug 2017 14:22:47 +0000 (15:22 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 23 Aug 2017 14:36:30 +0000 (10:36 -0400)
The opaque region of the window can be updated before we're requested
its creation on the compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=786673

gdk/wayland/gdkwindow-wayland.c

index 1b015346bcb71ef121675e4662748cfa70a0e219..3da3a9dd64e3cf8e972d1839907a7ee152967355 100644 (file)
@@ -1177,7 +1177,8 @@ gdk_wayland_window_sync_opaque_region (GdkWindow *window)
     wl_region = wl_region_from_cairo_region (GDK_WAYLAND_DISPLAY (gdk_window_get_display (window)),
                                              impl->opaque_region);
 
-  wl_surface_set_opaque_region (impl->display_server.wl_surface, wl_region);
+  if (impl->display_server.wl_surface)
+    wl_surface_set_opaque_region (impl->display_server.wl_surface, wl_region);
 
   if (wl_region != NULL)
     wl_region_destroy (wl_region);